import std.stdio;
import core.stdc.stdlib;

extern(C){
    size_t malloc_usable_size (void *ptr);
}

void main()
{
    writeln("object init = ",Object.init);
    
    writeln("ubyte[] init = ",(ubyte[]).init);
    
     writeln("int * init = ",(int *).init);
     writeln("int init = ",(int).init);
     
     writeln("\t");
     ubyte * p = cast(ubyte *)malloc(55);
     writeln("p = ", p);
     ubyte[] hh = p[0..55];
     auto tt = hh[0..20];
     writeln("hh.ptr = ", hh.ptr);
     writeln("tt.ptr = ", tt.ptr);
    // auto ptr = tt.ptr-1;
     writeln("ptr length = ", malloc_usable_size(tt.ptr));
     ubyte[] aa = ['a','a','a','a'];
     ubyte[] dd = aa;
      writeln("aa.ptr = ", aa.ptr);
     writeln("dd.ptr = ", dd.ptr);
     
     ubyte[] cc = aa.dup;
      writeln("aa.ptr = ", aa.ptr);
     writeln("cc.ptr = ", cc.ptr);
     
     writeln("int.max = ", int.max);
     writeln("int.max -655350 = ", int.max - 655350);
     
     auto e  = new Exception("this is a Exception!!","my.d",25);
     writeln(e.toString(), "\n");//, e.info.toString());
     //writeln(e);
     
     import std.traits;
     writeln("----------------");
     writeln(isSomeChar!byte);
     writeln(isSomeChar!ubyte);
     writeln(isSomeChar!short);
     writeln(isSomeChar!int);
     
     writeln(isSomeChar!dchar);
     writeln(isSomeChar!wchar);
     writeln(isSomeChar!char);
}
